<?php

class new_Controller extends GlobalAction {
	public $__default = 'HTML';
	
	public function proceedHTML () {
		if(empty($_POST)) {
			xine::$view->showForm();
		} else {
			$discussionId = xine::$model->newDiscussion($_POST);
			
			if($discussionId) header('Location: '.xine::$config['siteUrl'].'discussion/'.$discussionId);
			else echo xine::$model->error();
		}
	}
}